package com.eascs.admin.sys.exception;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.dubbo.config.annotation.Reference;
import com.eascs.site.controller.BaseRestController;
import com.eascs.site.view.BaseRestResult;
import com.eascs.workflow.common.entity.exception.JSErrorEntity;
import com.eascs.workflow.common.vo.ModelResult;
import com.eascs.workflow.common.service.exception.CatchJSException;

@RestController
@RequestMapping("/catchjs/rest")
public class CatchJSRestController extends BaseRestController {
	@Reference
	private CatchJSException catchJSException;
	
	@RequestMapping(value = "/save", method = RequestMethod.POST)
	@ResponseBody
	public BaseRestResult<String> save(JSErrorEntity jsError) {
		ModelResult<Boolean> modelResult=catchJSException.insert(jsError);
		Boolean result=modelResult.getModel();
		return BaseRestResult.buildRestResult(result.toString());
	}


}
